package com.atomic.test.example.entity;

import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by DreamYao on 2017/1/24.
 */
@Entity
@Table(name = "t_topic")
@EntityListeners(AuditingEntityListener.class)
public class Topic extends AbstractEntity<Integer> implements Serializable {
    private static final long serialVersionUID = -4585310526628240316L;

    /**
     * 所属论坛
     */
    @Column(name = "board_id")
    private Integer boardId;

    /**
     * 话题标题
     */
    @Column(name = "topic_title")
    private String topicTitle;

    /**
     * 发表用户
     */
    @Column(name = "user_id")
    private Integer userId;

    /**
     * 发表时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 最后回复时间
     */
    @Column(name = "last_post")
    private Date lastPost;

    /**
     * 浏览数
     */
    @Column(name = "topic_views")
    private Integer topicViews;

    /**
     * 回复数
     */
    @Column(name = "topic_replies")
    private Integer topicReplies;

    /**
     * 0:不是精华话题 1：是精华话题
     */
    @Column(name = "digest")
    private Integer digest;

    public Integer getBoardId() {
        return boardId;
    }

    public void setBoardId(Integer boardId) {
        this.boardId = boardId;
    }

    public String getTopicTitle() {
        return topicTitle;
    }

    public void setTopicTitle(String topicTitle) {
        this.topicTitle = topicTitle;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getLastPost() {
        return lastPost;
    }

    public void setLastPost(Date lostPost) {
        this.lastPost = lostPost;
    }

    public Integer getTopicViews() {
        return topicViews;
    }

    public void setTopicViews(Integer topicViews) {
        this.topicViews = topicViews;
    }

    public Integer getTopicReplies() {
        return topicReplies;
    }

    public void setTopicReplies(Integer topicReplies) {
        this.topicReplies = topicReplies;
    }

    public Integer getDigest() {
        return digest;
    }

    public void setDigest(int digest) {
        this.digest = digest;
    }
}
